package factory.abstractFactory;

import factory.bean.*;

import java.math.BigDecimal;
import java.util.ArrayList;

public class CarAndDriverLicenseFactory extends VehicleAbstractFactory{

    private Car car;
    
    @Override
    public Vehicle create() {
        car = new Car(new BigDecimal("120000"), "大众");
        return car;
    }

    @Override
    public DriverLicence getDriverLicense() {
        ArrayList<String> driverModels = new ArrayList<>();
        driverModels.add(car.getCarName());
        return new DriverLicenseByCar(1, driverModels);
    }
}
